$(function () {
    /**
     查询安灯andonStatus
     **/
    function getAandonStatus() {
        $.ajax({
            // url: '../json/getAandonStatus.json',
            url: baseUrl + 'getAanEvents',
            type: 'get'
            // dataType: 'default: Intelligent Guess (Other values: xml, json, script, or html)',
            // data: {
            //     method: 'getAandonStatus',
            // },
        })
            .done(function (data) {
                console.log("getAandonStatus");
                console.log(data)
                if (data.count >= 1) {
                    $(".user img").attr({
                        src: 'images/common/red.gif',
                    });
                } else {
                    $(".user img").attr({
                        src: 'images/common/blue.png',
                    });
                }
            })
            .fail(function () {
                console.log("error");
            })
    }

    getAandonStatus();

    setInterval(getAandonStatus, 5000);

})